<?php
/**
 * Created by PhpStorm.
 * User: 刚
 * Date: 2017/7/24
 * Time: 22:36
 */
include_once('AbstractPHPBook.php');

class OReillyPHPBook extends AbstractPHPBook
{
    private $author;
    private $title;
    private static $oddOrEven = 'odd';

    function __construct()
    {
        //alternate between 2 books
        if ('odd' == self::$oddOrEven) {
            $this->author = 'Rasmus Lerdorf and Kevin Tatroe';
            $this->title = 'Programming PHP';
            self::$oddOrEven='even';
        }else{
            $this->author='David Sklar and Adam Trachtenberg';
            $this->title='PHP Cookbook';
            self::$oddOrEven='odd';
        }
    }
    function getAuthor(){
        return $this->author;
    }
    function getTitle(){
        return $this->title;
    }
}